/*
 * =====================================================================================
 *
 *       Filename:  board.h
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  03/17/2012 02:19:11 PM
 *       Revision:  none
 *       Compiler:  arm-linux-gcc 4.4
 *
 *         Author:  Chen Yuheng (Chen Yuheng), chyh1990@163.com
 *   Organization:  Tsinghua Unv.
 *
 * =====================================================================================
 */


#ifndef  MACH_BOARD_AT91_H
#define  MACH_BOARD_AT91_H

#define AT91SAM_IO_START 0xF0000000
#define AT91SAM_DBGU_BASE 0xFFFFEE00
#define AT91C_BASE_AIC            (0xFFFFF000)  // (AIC) Base Address
#define AT91C_BASE_PIT           (0xFFFFFD30) // (PIT) Base Address
#include "at91-aic.h"
#include "at91-uart.h"
#include "at91-dbgu.h"


/* PIT definition */
#define PIT_MR                  (0)                     //PIT  Mode Register
#define PIT_SR                  (4)                     //PIT Status Register
#define PIT_PIVR                (8)                     //PIT Periodic Interval Value Register
#define PIT_PIIR                (12)            //PIT Periodic Interval Image Register


//extern macro
//
//CONFIG

#define SDRAM0_START 0x70000000
#define SDRAM0_SIZE  (0x8000000) //128M

#define IO_SPACE_START AT91SAM_IO_START
#define IO_SPACE_SIZE  0x10000000

#define HAS_RAMDISK

//#define KERNEL_PHY_BASE 0x70100000

#ifndef __ASSEMBLY__

#define UART0_TX 		((volatile unsigned char*) (AT91SAM_DBGU_BASE+DBGU_THR))

void board_init(void);
//used by bootloader, MUST be identical to linker script
//#define INITIAL_LOAD    ((volatile uintptr_t *) (0x73f01000))

#endif

#endif  
